﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RealState.Master" AutoEventWireup="true" CodeBehind="PostOffers.aspx.cs" Inherits="WebApplication.PostedOffers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=ddlCountry.ClientID%>').change(getState);
            $('#<%=ddlState.ClientID%>').change(getCity);
            $('#<%=ddlProperty.ClientID%>').change(getProperty);

            $('#<%=ddlCity.ClientID%>').append(new Option('--Select State-- ', ' --Select City -- ', false));
            $('#<%=ddlState.ClientID%>').append(new Option('--Select State-- ', ' --Select State -- ', false));
            $('#<%=ddlPropertyType.ClientID%>').append(new Option('--Select Property Type-- ', ' --Select Property Type -- ', false));


            $(":input[title]").each(function () {
                $(this).val($(this).attr("title"));
                $(this).bind('focus', function () {
                    if ($(this).val() == $(this).attr("title")) $(this).val('');
                });
                $(this).bind('blur', function () {
                    if ($(this).val() == '') $(this).val($(this).attr("title"));
                });
            });

        });

        function getProperty() {
            $("select[id$=ddlPropertyType] > option").remove();
            $('#<%=ddlPropertyType.ClientID%>').append(new Option('--Select Property Type-- ', ' --Select Property Type -- ', false));
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetPropertyType",
                data: "{Property: '" + $('#MainContent_ddlProperty').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    for (var i = 0; i < models.length; i++) {
                        
                        var val = models[i];
                        var text = models[i];
                        $('#MainContent_ddlPropertyType').append(new Option(text, val, false));
                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }


        function getState() {
            $("select[id$=ddlState] > option").remove();
            $('#<%=ddlState.ClientID%>').append(new Option('--Select State-- ', ' --Select State -- ', false));
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetState",
                data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    for (var i = 0; i < models.length; i++) {
                        var val = models[i];
                        var text = models[i];
                        $('#MainContent_ddlState').append(new Option(text, val, false));
                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }

        function getCity() {
            $("select[id$=ddlCity] > option").remove();
            $('#<%=ddlCity.ClientID%>').append(new Option('--Select State-- ', ' --Select City -- ', false));
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetCity",
                data: "{State: '" + $('#MainContent_ddlState').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    for (var i = 0; i < models.length; i++) {
                        var val = models[i];
                        var text = models[i];
                        $('#MainContent_ddlCity').append(new Option(text, val, false));
                    }

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="left">
	    <div class="breadcrum_inner"><a href="default.aspx">Home</a>  <span>Real Estate Post Offer</span></div>
        <div class="clear"></div>
        	<h3 class="white_db_box nfont dark_gray" style="width:255px; margin-left:15px;">Real Estate Post Offer</h3>
            <div class="clear"></div>
        	
          	<dl class="form clearfix" style="margin-left:15px;">
            <dt>
            	<br />
                <p class="purple" style="padding:0px 0px 0px 0px;"><strong>Location</strong></p>
                <div style="height:5px;"></div>
                
             	<div style="float:left; padding-right:20px;">
                    <asp:DropDownList ID="ddlCountry" runat="server">
                        </asp:DropDownList>
				</div>
            
                <div style="float:left; padding-right:20px;">
                	<asp:DropDownList ID="ddlState" runat="server">
                        </asp:DropDownList>
                </div>
            
            	<div style="float:left; padding-right:20px;">
					<asp:DropDownList ID="ddlCity" runat="server">
                        </asp:DropDownList>
				</div>
                
            	<div class="clear"></div>
                <br />
                <div style="float:left; padding-right:20px;">
                    <select id="letter" name="letter" tabindex="2">
                      <option value="1">Letter</option>
                    </select>
                </div>
                <div style="float:left; padding-right:20px;">
                <asp:TextBox ID="txtLandline" runat="server" MaxLength="20" CssClass="form-text"></asp:TextBox>
                    <%--<input type="text" class="form-text" value="Land Number " />--%>
                </div>
                <div class="clear"></div>
            </dt>
            <dt>
            	<p class="purple" style="padding:10px 0px 0px 0px;"><strong>Real Estate</strong></p>
                <div style="height:5px;"></div>
             	<div style="float:left; padding-right:20px;">
				<asp:DropDownList ID="ddlProperty"  runat="server">
                </asp:DropDownList>
                <div style="font-size:11px; color:#4F81BD; padding:5px 0px 0px 0px;">Residential/Commercial Types</div>
			</div>
            
            <div style="float:left; padding-right:20px;">
				<asp:DropDownList ID="ddlPropertyType" runat="server">
                </asp:DropDownList>
			</div>
            
            <div style="float:left; padding-right:20px;">
            <asp:TextBox ID="txtArea" runat="server" MaxLength="10" CssClass="form-text"></asp:TextBox>
				<%--<input type="text" class="form-text" value="Area (m2)" />--%>
			</div>
            <div class="clear"></div>
			<br />
            <div style="float:left; padding-right:20px;">
				<asp:DropDownList ID="ddlbedrooms" runat="server">
                <asp:ListItem Text="Bedrooms" />
                    <asp:ListItem Text="1" />
                    <asp:ListItem Text="2" />
                </asp:DropDownList>
			</div>
            <div style="float:left; padding-right:20px;">
				<asp:DropDownList ID="ddlBathRooms" runat="server">
                <asp:ListItem Text="Bath Rooms" />
                    <asp:ListItem Text="1" />
                    <asp:ListItem Text="2" />
                </asp:DropDownList>
			</div>
            <div class="clear"></div>
            </dt>
            
            <dt>
            	<p class="purple" style="padding:10px 0px 0px 0px;"><strong>Price</strong></p>
                <div style="height:5px;"></div>
                
             	<div style="float:left; padding-right:20px;">
                <asp:DropDownList ID="ddlPriceMode" runat="server">
                    <asp:ListItem Text="Price Mode" />
                    <asp:ListItem Text="Residential Home" />
                    <asp:ListItem Text="Commercial Land" />
                </asp:DropDownList>
				</div>
            
                <div style="float:left; padding-right:20px;">
                  <asp:TextBox ID="txtPriceM2" runat="server" CssClass="form-text"  MaxLength="20" ></asp:TextBox>
                  <asp:TextBox ID="txtTotalPrice" runat="server" CssClass="form-text" MaxLength="20" ></asp:TextBox>
                  <div style="font-size:11px; color:#4F81BD; padding:5px 0px 0px 140px;">Fill one of the Two</div>
                </div>
            
            	<div class="clear"></div>
            </dt>
            
            <dt>
            	<p class="purple" style="padding:0px 0px 0px 0px;"><strong>Picture Load</strong></p>
                <div style="height:5px;"></div>
                
             	<div style="float:left; padding-right:20px;">Main <br />
                <asp:FileUpload ID="upMain" CssClass="form-text" runat="server" />
				</div>
                <br />
                <div style="float:left; padding-right:20px;">4 others <br />
                <asp:FileUpload ID="up1" CssClass="form-text" runat="server" />
                <asp:FileUpload ID="up2" CssClass="form-text" runat="server" style="margin-left:20px;"/><div style="height:10px;" />
                <asp:FileUpload ID="up3" CssClass="form-text" runat="server" />
                <asp:FileUpload ID="up4" CssClass="form-text" runat="server" style="margin-left:20px;" />
                </div>
                </div>
                
            	<div class="clear"></div>
            </dt>
            
             <dt>
              <label>
              <asp:CheckBox ID="chkNewsLatter" Text="Send News Letter" runat="server" />
              <span class="blue">Confirm Above Information </span></label>
            </dt>
            <dt>
            <asp:Button ID="cmdSave" runat="server" CssClass="reg-blue-round-btn w75" Text="Load" /> 
            </dt>
          </dl>
        
    </div>
</asp:Content>
